import { createRouter, createWebHistory } from 'vue-router'
import Layouts from '../layouts/index.vue';
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      component: Layouts,
      redirect: '/BigScreen',
      children: [
        {
          path: "/BigScreen",
          name: 'BigScreen',
          component: () => import('../views/BigScreen/index.vue'),
          meta: {
            title: '首页',
            affix: true,
            noCache: true,
          },
        },
        {
          path: '/about',
          name: 'about',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/AboutView.vue'),
          meta: {
            title: '关于',
          },
        },
        {
          path: '/home',
          name: 'home',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/HomeView.vue'),
          meta: {
            title: 'Home',
          },
        },
        {
          path: '/memorandum',
          name: 'memorandum',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/Memorandum/index.vue'),
          meta: {
            title: '备忘录',
          },
        },
        {
          path: '/table',
          name: 'table',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/Table/index.vue'),
          meta: {
            title: '表格',
          },
        },
        {
          path: '/doubleTable',
          name: 'doubleTable',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/DoubleTable/index.vue'),
          meta: {
            title: '二级表格',
          },
        },
        {
          path: '/tabCard',
          name: 'tabCard',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/TabCard/index.vue'),
          meta: {
            title: '卡片',
          },
        },
      ]
    },

    {
      path: '/login',
      name: 'login',
      component: () => import('../views/Login/Login.vue')
    }
  ]
})

export default router
